home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / gemfsc15.lzh / AESSRC14.LZH / AESUTOB2.S < prev    next >
Text File  |  1989-08-26  |  2KB  |  70 lines

  1.  
  2. ;*========================================================================
  3. ;*
  4. ;* AESFAST Public Domain GEM bindings.
  5. ;*
  6. ;*  08/28/89 -  v1.3
  7. ;*              Renamed objc_xywh to obj_xywh.
  8. ;*========================================================================
  9.  
  10. ;*************************************************************************
  11. ;*
  12. ;* AESUTOB2.S - Object-related utilities 2 of n.
  13. ;*  Non-standard utility functions.
  14. ;*
  15. ;*  08/28/89 - v1.3
  16. ;*             Added obj_offxywh.
  17. ;*************************************************************************
  18.          
  19.           .include  "gemfast.sh"        ; Pull in header file.
  20.  
  21.           .extern   _objc_offset        ; we call this standard function.
  22.  
  23. ;-------------------------------------------------------------------------
  24. ; obj_xywh - Return object's xywh into GRECT structure.
  25. ;
  26. ;  void obj_xywh(tree, object, &grect);
  27. ;-------------------------------------------------------------------------
  28.  
  29. _obj_xywh::
  30.           .cargs    #4,.ptree.l,.obj.w,.prect.l
  31.           
  32.           move.l    .prect(sp),a1
  33.           move.l    .ptree(sp),a0
  34.           move.w    .obj(sp),d0
  35.           muls      #OBJ_SIZ,d0
  36.           lea       ob_x(a0,d0.l),a0
  37.           move.l    (a0)+,(a1)+
  38.           move.l    (a0),(a1)
  39.           rts
  40.  
  41. ;-------------------------------------------------------------------------
  42. ; obj_offxywh - Return object's xywh, adjusted to screen coordinates, 
  43. ;               into GRECT structure.
  44. ;
  45. ;  void obj_offxywh(tree, object, &grect);
  46. ;-------------------------------------------------------------------------
  47.  
  48. _obj_offxywh::
  49.           .cargs    #4,.ptree.l,.obj.w,.prect.l
  50.  
  51.           move.l    .prect(sp),a1
  52.           move.l    .ptree(sp),a0
  53.           move.w    .obj(sp),d0
  54.           move.w    d0,d1
  55.           
  56.           muls      #OBJ_SIZ,d0
  57.           move.l    ob_w(a0,d0.l),g_w(a1)    ; fill in width/height
  58.  
  59.           pea       g_y(a1)             ; ptr to prect->g_x
  60.           pea       g_x(a1)             ; ptr to prect->g_y
  61.           move.w    d1,-(sp)            ; obj number
  62.           move.l    a0,-(sp)            ; ptr to tree
  63.           jsr       _objc_offset        ; call objc_offset to fill in x/y
  64.           lea       14(sp),sp           ; clean up stack
  65.  
  66.           rts
  67.  
  68. ;         end of code
  69.  
  70.